home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_vol_dart_trap2.cog < prev    next >
Text File  |  1999-11-15  |  7KB  |  252 lines

  1. # Jones 3D Cog Script
  2. #
  3. # VOL_Dart_Trap.cog
  4. #
  5. # This cog will run a 3 location dart firing sequence upon an entered message.
  6. #
  7. # [CM]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14.  
  15. #....................MESSAGES.....................#
  16. message    startup
  17. message    touched
  18. message    entered
  19. message    arrived
  20.  
  21.  
  22. #....................ACTORS.....................#
  23. thing    player                                                local
  24. thing    indyActor
  25.  
  26. thing    looktarg
  27.  
  28.  
  29. #....................CAMERAS.....................#
  30. thing    warningCam
  31.  
  32.  
  33.  
  34. #....................EVENT GHOSTS.....................#
  35. thing    smoke                                                local
  36. thing    dartgenpos0
  37. thing    dartgenpos1
  38. thing    dartgenpos2
  39.  
  40.  
  41. #....................PROPS.....................#
  42. thing    missile0                                            local
  43. thing    missile1                                            local
  44. thing    missile2                                            local
  45. thing    deadmissile                                            local
  46.  
  47. #....................TRIGGERS.....................#
  48. sector    primesect
  49. sector    clearsect
  50.  
  51. surface    triggersurf0
  52. surface    triggersurf1
  53. surface    triggersurf2
  54.  
  55. #....................KEYFRAMES....................#
  56. keyframe    in_hat=0in_figithat_4_4.key                        local
  57. keyframe    in_brush=0in_stand1_bd_4.key                    local
  58. keyframe    in_stand4=0in_stand4.key                        local
  59. keyframe    inReach=in_reach_medium.key                        local
  60.  
  61.  
  62.  
  63. #....................TEMPLATES.....................#
  64. template    dtemp=dart                                      local 
  65. template    smoketemplate=+dartsmoke_spr                    local
  66.  
  67. #....................SOUNDS.....................#
  68. sound    blast=pru_dart_fired_c.wav                            local
  69. sound    tink=shs_bell_dull.wav                                local    #must be pitch-bent for proper effect
  70. sound    readytrap=teo_crush_prime_c.wav                        local
  71. sound    stab=fol_sp_attack.wav                                local
  72. sound    in_creepyfeel=INXJ047.WAV                            local    # skulls mystic signs...
  73.  
  74. sound    creepy_cue=mus_gen_danger2.wav                        local
  75.  
  76. #....................VARIABLES.....................#
  77. int        scene=0                                                local
  78. int        hitsound                                            local
  79. int        snd                                                    local
  80. int        track                                                local
  81. int        playerpos=0                                            local
  82.  
  83. end
  84.  
  85. # ========================================================================================
  86. code
  87.  
  88. startup:
  89.  
  90.     # get the player
  91.     player = GetLocalPlayerThing();
  92.     return;
  93.  
  94. # ========================================================================================
  95. entered:
  96.  
  97.     If ((GetSenderRef() == primesect) && (GetSourceRef() == player))
  98.         {
  99.             If (scene == 1) return;
  100.             # stop the player's motion, and swap the actor in
  101.             MakeMeStop();
  102.             StartCutScene(1);
  103.             scene = 1;
  104.             PlaySoundLocal(readytrap, 0.5, 1.0, 0x0, 0);
  105.             
  106.             CopyOrientAndPos(player, indyActor);
  107.             CopyPlayerHolsters(player, indyActor);
  108.             SetThingFlags(player, 0x80000);
  109.             ClearThingFlags(indyActor, 0x80000);
  110.             
  111.             # line up the actor
  112.             AISetLookThing(indyActor, looktarg);
  113.             # move cam to known position
  114.             SetExtCamOffsetToThing(warningCam);
  115.             AIWaitForStop(indyActor);
  116.  
  117.             PlaySoundLocal(creepy_cue, 0.5, 1.0, 0x0, 0);
  118.             
  119.             # play indy's anims and voice line
  120.             track = PlayKey(indyActor, in_Stand4, 2, 0x0, 0);
  121.             PlayKey(indyActor, in_brush, 4, 0x12, 1);
  122.             snd = PlayVoice(indyActor, in_creepyfeel, 0.75, 0);
  123.             PlayKey(indyActor, in_hat, 4, 0x12, 0);
  124.             WaitForSound(snd);
  125.             Sleep(0.25);
  126.  
  127.             # restore the player
  128.             CopyOrientAndPos(indyActor, player);
  129.             ClearThingFlags(player, 0x80000);
  130.             SetThingFlags(indyActor, 0x80000);
  131.             Sleep(0.5);
  132.             # end the scene
  133.             ClearActorFlags(player, 0x200000);
  134.             RestoreExtCam();
  135.             EndCutscene();
  136.         }
  137.  
  138.  
  139.     If ((GetSenderRef() == clearsect) && (GetSourceRef() == player))
  140.         {
  141.         scene = 1;
  142.         }
  143.     
  144.     If (GetSenderRef() == triggersurf0)
  145.         {
  146.         smoke = CreateThing(smoketemplate, dartgenpos0);
  147.         missile0 = CreateThing(dtemp, dartgenpos0);
  148.         CaptureThing(missile0);
  149.         PlaySoundThing(blast, missile0, 2.0, 0, 20, 0);
  150.         MoveToFrame(missile0, 1, 10);
  151.         Sleep(.25);
  152.         }
  153.     
  154.  
  155.     If (GetSenderRef() == triggersurf1)
  156.         {
  157.         smoke = CreateThing(smoketemplate, dartgenpos1);
  158.         missile1 = CreateThing(dtemp, dartgenpos1);
  159.         CaptureThing(missile1);
  160.         PlaySoundThing(blast, missile1, 2.0, 0, 20, 0);
  161.         MoveToFrame(missile1, 1, 10);
  162.         Sleep(.25);
  163.         }
  164.     
  165.  
  166.     If (GetSenderRef() == triggersurf2)
  167.         {
  168.         smoke = CreateThing(smoketemplate, dartgenpos2);
  169.         missile2 = CreateThing(dtemp, dartgenpos2);
  170.         CaptureThing(missile2);
  171.         PlaySoundThing(blast, missile2, 2.0, 0, 20, 0);
  172.         MoveToFrame(missile2, 1, 10);
  173.         Sleep(.25);
  174.         }
  175.  
  176. return;
  177.  
  178. # ========================================================================================
  179. arrived:
  180.  
  181.     If (GetSenderRef() == missile0)
  182.         {
  183.             DestroyThing(missile0);
  184.             hitsound = PlaySoundLocal(tink, 0.1, -1, 0x0, 0);
  185.             #ChangeSoundPitch(hitsound, 6, 0);
  186.         }
  187.  
  188.     If (GetSenderRef() == missile1)
  189.         {
  190.             DestroyThing(missile1);
  191.             hitsound = PlaySoundLocal(tink, 0.1, -1, 0x0, 0);
  192.             #ChangeSoundPitch(hitsound, 6, 0);
  193.         }
  194.  
  195.     If (GetSenderRef() == missile2)
  196.         {
  197.             DestroyThing(missile2);
  198.             hitsound = PlaySoundLocal(tink, 0.1, -1, 0x0, 0);
  199.             #ChangeSoundPitch(hitsound, 6, 0);
  200.         }
  201. return;
  202.  
  203.  
  204. # ========================================================================================
  205.  
  206. # ========================================================================================
  207. touched:
  208.  
  209.  
  210. if ((GetSenderRef() == missile0) && (GetSourceRef() == GetLocalPlayerThing()))
  211.     {
  212.     #Print("ouch");
  213.     DamageThing(GetSourceRef(), 150.0, 0x1, missile0);
  214.     
  215.     PlaySoundLocal(stab, 1.0, 0.0, 0x0, 0);
  216.     DestroyThing(missile0);
  217.     }
  218.  
  219.  
  220. if ((GetSenderRef() == missile1) && (GetSourceRef() == GetLocalPlayerThing()))
  221.     {
  222.     #Print("ouch");
  223.     DamageThing(GetSourceRef(), 150.0, 0x1, missile1);
  224.     
  225.     PlaySoundLocal(stab, 1.0, 0.0, 0x0, 0);
  226.     DestroyThing(missile1);
  227.     }
  228.  
  229.  
  230. if ((GetSenderRef() == missile2) && (GetSourceRef() == GetLocalPlayerThing()))
  231.     {
  232.     #Print("ouch");
  233.     DamageThing(GetSourceRef(), 150.0, 0x1, missile2);
  234.     
  235.     PlaySoundLocal(stab, 1.0, 0.0, 0x0, 0);
  236.     DestroyThing(missile2);
  237.     }
  238.     
  239.     
  240. return;
  241.  
  242.  
  243.  
  244. # ========================================================================================
  245. # ========================================================================================
  246.  
  247. end
  248.  
  249.  
  250.  
  251.  
  252.